package com.bite.lesson2;

import java.util.Scanner;

public class Demo_04 {
    public static void main(String[] args) {
        final String password = "123456";
        int time = 3;
        Scanner scanner = new Scanner(System.in);
        System.out.println("你还有 " + time + " 机会......");
        while (scanner.hasNextLine()) {
            String ret = scanner.nextLine();

            if (password.equals(ret)) {
                System.out.println("恭喜，对了......");
                return;
            } else {
                time--;
                if (time == 0) break;
                System.out.println("你还有 " + time + " 机会......");

            }
        }
        System.out.println("机会用尽......");
        return;
    }
}
